//
//  CustomTableViewCell.m
//  CommentsTableView
//
//  Created by Gamefire on 16/4/20.
//  Copyright © 2016年 Gamefire. All rights reserved.
//

#import "CustomDetailsTableViewCell.h"

@implementation CustomDetailsTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        UIView *topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0.5, [UIScreen mainScreen].bounds.size.width, 1)];
        [topView setBackgroundColor:[UIColor colorWithRed:236.0 /255.0 green:236.0 /255.0 blue:236.0 /255.0 alpha:1]];
        [self addSubview:topView];
        
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 6, 37, 37)];
        [imageView setBackgroundColor:[UIColor blackColor]];
        [imageView.layer setCornerRadius:37.0/ 2.0];
        [self addSubview:imageView];
        
        UILabel *labelname = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(imageView.frame) + 12.0, 8, 80, 13)];
        [labelname setText:@"小土豆520"];
        [labelname setTextColor:[UIColor colorWithRed:66.0 /255.0  green:66.0 /255.0 blue:66.0 /255.0 alpha:1]];
        [labelname setFont:[UIFont systemFontOfSize:15.0]];
        [self addSubview:labelname];
        
        UILabel *commentlabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(imageView.frame) + 12.0, CGRectGetMaxY(labelname.frame) + 9.0, 130, 15)];
//        [commentlabel setBackgroundColor:[UIColor greenColor]];
        [commentlabel setText:@"哇哈哈,拥抱大自然!"];
        [commentlabel setTextColor:[UIColor colorWithRed:109.0 /255.0 green:109.0 /255.0 blue:109.0 /255.0 alpha:1]];
        [commentlabel setFont:[UIFont systemFontOfSize:15.0]];
        [self addSubview:commentlabel];
        
        UIButton *replyBtn = [[UIButton alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width - 41.0, CGRectGetMaxY(labelname.frame) + 3.0, 30, 25)];
        [replyBtn setTitle:@"回复" forState:UIControlStateNormal];
        [replyBtn.titleLabel setFont:[UIFont systemFontOfSize:15.0]];
        [replyBtn setTitleColor:[UIColor colorWithRed:111.0/255.0 green:203.0/255.0 blue:253.0/255.0 alpha:1] forState:UIControlStateNormal];
        [self addSubview:replyBtn];
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
